#!/usr/bin/python
import socket
import sys
host = sys.argv[1]
	
try:
        info = socket.getaddrinfo(host,None)
        # info = (family ,socktype , proto , canonname , sock address)
        #   	print "family : %s\nsock type : %s\nproto : %s\ncanon name : %s\nsock address : %s"%(info[0],info[1],info[2],info[3],info[4])
        print info
        tool = par_net(info)
        tool.get_info()

except  socket.error,e:
        print "some error : %s " %e

class par_net:
    	def __inti__(self,info):
		self.info  = info
	def get_info(self):
	    	map(self.print_info,self.info)
	def print_info(self,each_info):
	    	print "family : %s\nsock type : %s\nproto : %s\ncanon name : %s\nsock address : %s\n" %(each_info[0],each_info[1],each_info[2],each_info[3],each_info[4])
	


